package cron.core.scheduler.trigger;

/**
 * @author : willian fu
 * @version : 1.0
 * @date : 2021/3/10 0010 13:42
 */
public enum TriggerType {

    /**
     * cron 表达式
     */
    CRON("cron"),

    /**
     * 固定频率
     */
    FIX_RATE("fix");

    private String value;

    TriggerType(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static TriggerType valuesOf(String value){
        for (TriggerType triggerType : TriggerType.values()) {
            if (triggerType.getValue().equals(value)){
                return triggerType;
            }
        }
        return null;
    }

}
